// import request from '@/utils/request'

export function login(data: IUser.Request.ILogin): Promise<IUser.Response.ILogin> {
  console.log(data)

  return Promise.resolve({
    id: 1,
    name: '癸',
    role: 1,
    slogan: '',
    avatar: '',
    lastIn: Date.now()
  })
}

export function getAccess(): Promise<IUser.Response.IAccess[]> {
  return Promise.resolve([
    { id: 1, parentId: 0, name: 'dashboard', key: 'dashboard' },
    { id: 2, parentId: 0, name: '文章管理', key: 'article' },
    { id: 3, parentId: 2, name: '文章管理', key: 'article.manage', action: ['add', 'delete'] },
    { id: 4, parentId: 2, name: '文章预览', key: 'article.detail' },
    { id: 5, parentId: 2, name: '开始创作', key: 'article.create', view: ['author'] }
  ])
}
